package com.icss.flow.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
/**
 * @Description 字段类型sql
 * @author wzg
 */

@AllArgsConstructor
@Getter
public enum FieldTypeEnum {
    INPUT("input","varchar(100)"),
    TEXTAREA("textarea","text"),
    NUMBER("number","int"),
    RADIO("radio","varchar(40)"),
    CHECKBOX("checkbox","varchar(40)"),
    SELECT("select","varchar(40)"),
    TIME("time","dateTime"),
    TIME_RANGE("time-range","varchar(40)"),
    DATE("date","date"),
    DATE_RANGE("date-range","varchar(40)"),
    SWITCH("switch","tinyint"),
    RATE("rate","double"),
    COLOR("color","varchar(40)"),
    SLIDER("slider","varchar(40)"),
    STATIC_TEXT("static-text","varchar(40)"),
    HTML_TEXT("html-text","text"),
    BUTTON("button","varchar(40)"),
    DIVIDER("divider","varchar(40)");

    private final String fieldType;
    private final String fieldTypeSql;

    public static FieldTypeEnum getType(String fieldType) {
        for (FieldTypeEnum value : FieldTypeEnum.values()) {
            if (value.getFieldType().equalsIgnoreCase(fieldType)) {
                return value;
            }
        }
        return INPUT;
    }



}
